#ifndef _VARIANT_ARDUINO_STM32_
#define _VARIANT_ARDUINO_STM32_

#define digitalPinToPort(P)        ( PIN_MAP[P].gpio_device )
#define digitalPinToBitMask(P)     ( BIT(PIN_MAP[P].gpio_bit) )
#define portOutputRegister(port)   ( &(port->regs->ODR) )
#define portInputRegister(port)    ( &(port->regs->IDR) )

#define portSetRegister(pin)		( &(PIN_MAP[pin].gpio_device->regs->BSRR) )
#define portClearRegister(pin)		( &(PIN_MAP[pin].gpio_device->regs->BRR) )

#define portConfigRegister(pin)		( &(PIN_MAP[pin].gpio_device->regs->CRL) )

static const uint8_t SS   = BOARD_SPI1_NSS_PIN;
static const uint8_t SS1  = BOARD_SPI2_NSS_PIN;
static const uint8_t MOSI = BOARD_SPI1_MOSI_PIN;
static const uint8_t MISO = BOARD_SPI1_MISO_PIN;
static const uint8_t SCK  = BOARD_SPI1_SCK_PIN;

#define XA1	PA1
#define XA2	PA2
#define XA3	PA3
#define YA1	PA4
#define YA2	PA5
#define Y1	PB12
#define Y2	PA7
#define Y3	PC4
#define Y4	PC5
#define Y5	PB0
#define Y6	PB1

#define BACKLIGHT	PE2
#define	BEEP	PA0

void FSMC_ili9327_Init(void);
void gui_setup();
void gui_loop();
#endif /* _VARIANT_ARDUINO_STM32_ */